<template>
	<ul>
		<li v-for='item in hotList'>
			<router-link :to="{name:'detail', params:{'id':item.id}}">
				<img :src="item.cover.origin" alt="">
				<div class="infobox">
					<p class="mvname">{{item.name}}</p>
					<P class="mvnum">{{item.cinemaCount}}家影院上映{{item.watchCount}}人购票</P>
					<span class="mvscore">{{item.grade}}</span>
				</div>
			</router-link>
		</li>
		<li class="last">
			<router-link class="more" :to="{name:'nowplaying'}">
				更多热映电影
			</router-link>
		</li>
	</ul>
</template>
<script>
	import $ from 'jquery';
	export default{
		data:function () {
			return {
				hotList:[]
			}
		},
		mounted:function () {
				var that = this;
				var hotUrl = 'http://localhost:3000/hot?time='+new Date().getTime();
				$.get(hotUrl,function(res) {
				that.hotList = res.data.films;
			});
		}
	}
</script>